package com.example.demo.Controller

import com.example.demo.Interface.RadCheckRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

/**
 * Created by lip on 2017/5/25.
 *  Radius check controller
 */

@RestController
        class RadcheckController @Autowired constructor (val repository: RadCheckRepository) {

    @RequestMapping("/")
    fun findAll() = repository.findAll()

    @RequestMapping("/{username}")
    fun findByUserName(@PathVariable name: String) = repository.findByUsername(name)
}